Skip to content

fix(mobile): push gating and personal-team hardening for Android PR#3643

Merged
juliusmarminge merged 2 commits into
android-dev-pr-3514from
fix/android-pr-push-gating
Jul 9, 2026
Merged

fix(mobile): push gating and personal-team hardening for Android PR#3643
juliusmarminge merged 2 commits into
android-dev-pr-3514from
fix/android-pr-push-gating

Conversation

@bmdavis419

@bmdavis419 bmdavis419 commented Jul 2, 2026

Copy link
Copy Markdown

PR into #3579 carrying the fixes from #3575 that its snapshot of that branch missed (it absorbed an older version of fix/mobile-device-builds-and-android-ui).

What's included

Push registration gating for Personal Team builds (cherry-picked from #3575's 2e5b83f4c):

  • New agent-awareness/capabilities.ts with supportsAgentAwarenessPush(), driven by extra.iosPersonalTeamBuild
  • Relay device registration payload forces liveActivitiesEnabled/notificationsEnabled off when push is unsupported (+ test)
  • Settings switches for Device Notifications and Live Activity Updates disabled/forced-off on Personal Team builds

Hardening on top:

  • nativePushTokenRegistration now also checks supportsAgentAwarenessPush(), so Personal Team builds never call getDevicePushTokenAsync() without the aps-environment entitlement (previously only the payload was gated — a build with previously-granted permission would still attempt token acquisition and could stall waiting on didRegisterForRemoteNotifications)
  • T3CODE_IOS_PERSONAL_TEAM_BUNDLE_ID validated as a reverse-DNS identifier instead of just non-empty
  • extra.iosPersonalTeamBuild exposed in the Expo config (required for the runtime gating above)
  • Comment documenting that the appleSignIn: !isIosPersonalTeamBuild gate on the Clerk plugin is load-bearing (the .cjs entitlements plugin runs before plugins earlier in the array, so it can't strip Clerk's entitlement)
  • Restored react-native-keyboard-controller 1.21.7 — main bumped it in [codex] Upgrade Legend List chat scrolling #3545; the 1.21.6 pin here is a stale carryover that would silently downgrade it at merge

Verification

  • tsc --noEmit passes
  • agent-awareness tests pass (28/28)
  • The equivalent merged state was built as a release APK and verified running on a Pixel 10 Pro Fold

Supersedes #3575, which is now closed.

🤖 Generated with Claude Code


Open in Devin Review

Note

Gate push notifications and disable notification settings for Personal Team Android builds

  • Adds a supportsAgentAwarenessPush utility that returns false when iosPersonalTeamBuild is set in Expo config extras, used as a single gate across the push registration flow.
  • nativePushTokenRegistration short-circuits without requesting permissions or an APNs token, returning { notificationsEnabled: false, pushToken: null } for Personal Team builds.
  • The relay registration payload forces liveActivitiesEnabled and notificationsEnabled to false in Personal Team builds via makeRelayDeviceRegistrationRequest.
  • The Device Notifications and Live Activity Updates switches in SettingsRouteScreen are disabled and forced off when push is unavailable.
  • Adds bundle identifier validation in app.config.ts that rejects missing or non-reverse-DNS values when T3CODE_IOS_PERSONAL_TEAM=1.

Macroscope summarized 49f5f1d.


Note

Low Risk
Targeted mobile build-variant gating with tests; no auth or server contract changes beyond reporting push prefs as disabled.

Overview
Personal Team iOS builds (no aps-environment / push entitlements) now treat agent-awareness push as unavailable end-to-end instead of only lying in the relay payload.

extra.iosPersonalTeamBuild is set in Expo config from T3CODE_IOS_PERSONAL_TEAM=1, and supportsAgentAwarenessPush() in capabilities.ts is the runtime switch. nativePushTokenRegistration returns early without calling getDevicePushTokenAsync() or permission reads, avoiding stalls on didRegisterForRemoteNotifications. Relay registration via makeRelayDeviceRegistrationRequest forces notificationsEnabled and liveActivitiesEnabled off when push is unsupported. Settings Device Notifications and Live Activity toggles are disabled and shown off on those builds.

Build-time hardening: T3CODE_IOS_PERSONAL_TEAM_BUNDLE_ID must match a reverse-DNS pattern (not merely non-empty). A comment documents why appleSignIn: !isIosPersonalTeamBuild on @clerk/expo must stay—the personal-team entitlements plugin cannot strip Clerk’s Sign in with Apple entitlement.

Reviewed by Cursor Bugbot for commit 49f5f1d. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ce9681a8-fc46-44f3-babe-b6b0c5fec17d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/android-pr-push-gating

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Jul 2, 2026
@macroscopeapp

macroscopeapp Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR propagates a new configuration flag to gate push notification features across multiple code paths. While the implementation is clean, changes that control whether significant functionality (notifications, live activities) is enabled or disabled warrant human review due to their behavioral impact.

You can customize Macroscope's approvability policy. Learn more.

@juliusmarminge juliusmarminge force-pushed the android-dev-pr-3514 branch 2 times, most recently from 1053338 to 2ae9365 Compare July 3, 2026 06:13
@juliusmarminge juliusmarminge force-pushed the fix/android-pr-push-gating branch from 4c5185e to 7be02cf Compare July 3, 2026 06:16

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 7be02cf. Configure here.

Comment thread apps/mobile/src/features/agent-awareness/registrationPayload.ts
bmdavis419 and others added 2 commits July 8, 2026 04:07
- Validate T3CODE_IOS_PERSONAL_TEAM_BUNDLE_ID as a reverse-DNS identifier
- Expose extra.iosPersonalTeamBuild so runtime capability gating works
- Gate native APNs token acquisition on supportsAgentAwarenessPush() so
  Personal Team builds never call getDevicePushTokenAsync without the
  aps-environment entitlement
- Document why appleSignIn gating on the Clerk plugin is load-bearing
- Restore react-native-keyboard-controller 1.21.7 (main bumped it in #3545;
  1.21.6 here was a stale pin)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@juliusmarminge juliusmarminge force-pushed the fix/android-pr-push-gating branch from 7be02cf to 49f5f1d Compare July 8, 2026 11:13
@juliusmarminge juliusmarminge merged commit 7e79b0c into android-dev-pr-3514 Jul 9, 2026
16 checks passed
@juliusmarminge juliusmarminge deleted the fix/android-pr-push-gating branch July 9, 2026 04:37
juliusmarminge pushed a commit that referenced this pull request Jul 9, 2026
…3643)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
juliusmarminge pushed a commit that referenced this pull request Jul 9, 2026
…3643)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
juliusmarminge pushed a commit that referenced this pull request Jul 9, 2026
…3643)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants